/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf.views;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dchapman
 */
@Entity
@Table(name = "Malt")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MaltInventoryView.findAll", query = "SELECT m FROM MaltInventoryView m ORDER BY m.maltName ASC")})
public class MaltInventoryView implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "MaltID")
    private Integer maltID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 60)
    @Column(name = "MaltName")
    private String maltName;
    @Basic(optional = false)
    @NotNull
    @Column(name = "MaltOnHand")
    private float maltOnHand;
    @Basic(optional = false)
    @NotNull
    @Column(name = "MaltSpoken")
    private float maltSpoken;
    @Basic(optional = false)
    @NotNull
    @Column(name = "MaltOnOrder")
    private float maltOnOrder;

    public MaltInventoryView() {
    }

    public MaltInventoryView(Integer maltID) {
        this.maltID = maltID;
    }

    public MaltInventoryView(Integer maltID, String maltName, float maltOnHand, float maltSpoken, float maltOnOrder) {
        this.maltID = maltID;
        this.maltName = maltName;
        this.maltOnHand = maltOnHand;
        this.maltSpoken = maltSpoken;
        this.maltOnOrder = maltOnOrder;
    }

    public Integer getMaltID() {
        return maltID;
    }

    public void setMaltID(Integer maltID) {
        this.maltID = maltID;
    }

    public String getMaltName() {
        return maltName;
    }

    public void setMaltName(String maltName) {
        this.maltName = maltName;
    }

    public float getMaltOnHand() {
        return maltOnHand;
    }

    public void setMaltOnHand(float maltOnHand) {
        this.maltOnHand = maltOnHand;
    }

    public float getMaltSpoken() {
        return maltSpoken;
    }

    public void setMaltSpoken(float maltSpoken) {
        this.maltSpoken = maltSpoken;
    }

    public float getMaltOnOrder() {
        return maltOnOrder;
    }

    public void setMaltOnOrder(float maltOnOrder) {
        this.maltOnOrder = maltOnOrder;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (maltID != null ? maltID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MaltInventoryView)) {
            return false;
        }
        MaltInventoryView other = (MaltInventoryView) object;
        if ((this.maltID == null && other.maltID != null) || (this.maltID != null && !this.maltID.equals(other.maltID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.MaltInventoryView[ maltID=" + maltID + " ]";
    }
}
